﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using _4T.Data;
using _4T.DAL;

namespace _4T
{
    public partial class Personal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString().Trim().CompareTo(string.Empty) != 0)
            {
                PersonalInfo personalInfo = new PersonalInfoDAL().GetPersonalInfo(Request.QueryString["id"].ToString().Trim());
                if (personalInfo != null)
                {
                    getInfo(personalInfo);
                }
                else
                {
                    Response.Redirect("index.aspx");
                }
            }
            else
            {
                Response.Redirect("index.aspx");
            }
        }

        private void getInfo(PersonalInfo personalInfo)
        {
            lblFullName.Text = personalInfo.FullName;
            //
            if (personalInfo.Email != null && personalInfo.Email.CompareTo(string.Empty) != 0)
                lblEmail.Text = personalInfo.Email;
            else
                lblEmail.Text = "Chưa cập nhật";
        }
        //
        //
        //
        private void pageNotFound()
        {
        }
        //
    }
}